<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <input id="inp" cc='okk' data-cc='aaa' type="file">
</body>
<script>
        document.querySelector('#inp').addEventListener('change',function(e){
            console.log(this.getAttribute('cc'))
            console.log(e.target.getAttribute('data-cc'))
            console.log(e.target.dataset.cc)
            console.log(this)
           this.setAttribute('my','我')
            console.log(e)
            // 处理完逻辑后  e.target.value=''清空  解决紧接着两次上传同样文件无反应。
            e.target.value=''
            setTimeout(()=>console.log(this.getAttribute('my')),1500)
        })
        
</script>
</html>